package com.anxuan.lab2.demo1;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@EnableConfigurationProperties(CustomProperties.class)
public class Lab2AutoConfig {

   @Bean
   @ConditionalOnProperty(prefix = "sai.auto" ,name = "enable",havingValue = "true")
  CommandLineRunner createCustomCommandLineRunner(Environment env){
      return new CustomCommandLineRunner(env);
   }




}
